0

I'm iterating through a collection of child object records and grabbing the values of 3 different fields and I'm adding them to one field on the Master (Asset Roll-up). As I assign the child object's values, I add a semi-colon as a separator. I assign them to a variable in the Flow, then assign them to the SObject variable and Update it to the actual field in Salesforce. When I do, I get an extra semi-colon for each blank value, because each field needs a semi-colon after each value.

Parent Object = Parent Object, Field = Asset Rollup. Child Object = Child Object, Fields = Asset Name, Other Asset Name, Archived Asset Name.

Record 1: Asset Name = "Carrots". Asset Other Name = blank. Archived Asset Name = blank.

Record 2: Asset Name = "Peas". Asset Other Name = blank. Archived Asset Name = blank.

Record 3: Asset Name = "Potatoes" Asset Other Name = "Spuds", Archived Asset Name = blank. Asset Roll-up: "Carrots;;Peas;;Potatoes;Spuds;"

If I remove the semi-colon, the values have no separator. I've even created 3 new fields, one for each field from the Child object and used a workflow rule to populate the values and am still getting the extra semi-colons.

I can provide screen shots.

  • You may need to add an extra conditional to make sure the value isnt null. If null, add empty string, if not add the semi-colon. – Rodrigo Jan 11 at 0:19
  • So I have a decision tree that says "if the value is populated, then populate this variable with the value + a semi-colon", and "if the value is a blank string, then proceed to the next decision (does the Asset Other Name' have a value), etc. But you're suggesting adding another assignment to add a blank value? – SMcEvoy Jan 11 at 15:51
0

My colleague suggested I use the 'equals' then 'Create New' Formula for the Assignment of the Asset Name to the AssetList variable. I'll see if this works but I'm pretty sure it will!

  • So I'll use an IF statement so that If (ISNULL(variable AssetList ), if true, then add the Asset Name, if false, add a semi-colon + the Asset Name). I'll do it for all 3 of the fields (Asset Other Name & Archived Asset Name), then assign that to the variable for the complete list of values and finally update the Parent Object's "Asset Rollup" field. – SMcEvoy Jan 11 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.