Skip to main content
Solved

String concatenator not writing string from JSON


Forum|alt.badge.img

Hi,

I am trying to concatenate a string. The attribute I am using in the concatenation has been extracted from JSON into a list then exploded into an attribute. However, the string concatenator is not ignoring the attribute, the result just has the other string values concatenated together without the attribute value.

Any pointers would be much appreciated. Example workbench is here;

Thanks

Best answer by ebygomm

The values you want are already present in an array at the attributefilter. If you use an attributeexposer to expose array{} you can then use the list exploder on this and then the value you need for your string concatenator is stored in an attribute called array

View original
Did this help you find an answer to your question?

5 replies

david_r
Celebrity
  • August 8, 2018

Insert a breakpoint on the input connection to the StringConcatenator, execute the workspace with breakpoints enabled and inspect the attribute values.

More info on breakpoints: https://desktopmanualbasic.safe.com/DesktopBasic3BestPractice/3.17.FeatureDebugging.html


Forum|alt.badge.img
  • Author
  • August 8, 2018
david_r wrote:

Insert a breakpoint on the input connection to the StringConcatenator, execute the workspace with breakpoints enabled and inspect the attribute values.

More info on breakpoints: https://desktopmanualbasic.safe.com/DesktopBasic3BestPractice/3.17.FeatureDebugging.html

Thanks David. I have been inspecting the data along the way. I have also since added an attribute validator before the string concatenation and found that the attribute value is not a string but an alphanumeric. How do I change the format to string?

 

 


david_r
Celebrity
  • August 8, 2018

I had a look at the workspace you posted (thanks for making it runnable without any external dependencies!).

The issue is that the StringConcatenator references an attribute "folders" that doesn't exist at run-time:

The right hand side is showing the feature attributes that's entering the StringConcatenator. As you can see in the square, there are no attributes called "folders". Maybe you want the value from "_folderlist"? If so, you need to fix the JSONFlattener setting before modifying the StringConcatentor accordingly:


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • August 8, 2018

The values you want are already present in an array at the attributefilter. If you use an attributeexposer to expose array{} you can then use the list exploder on this and then the value you need for your string concatenator is stored in an attribute called array


Forum|alt.badge.img
  • Author
  • August 8, 2018
Thanks @egomm and @david_r both of your suggestions did the trick.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings