Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Fusion Parse error if one record is null

Avatar

Level 10

I have a scenario that takes 3 typeahead fields and parses them into an array where I then add them as assignees on a created task. The three typeahead fields are:

DE: D2D Account Lead - Creative.

DE: D2D Account Lead - Digital.

DE:HCG EG Strategic Steward.

If the company I'm pulling from has all 3 filled out, everything works fine. If there are any blank fields I get a "Source is not valid JSON." error. I don't know what kind of error handling I can use to go ahead and create the array with only 2 entries. Screenshots below.

Parse Module.jpg

I could just add a service account to all un-staffed typeahead fields but that's a hack. Is there a right way to handle this error?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Well, here it is. It's big, it's messy but it works. Setup dialog is on top, result dialog is below. I can't help but think there's a better way with less steps but for now, it works.

TASK-Add CAP to Proj Users.jpg

3 Replies

Avatar

Level 5

Hey Randy - I don't know that it's any better than the hack you describe, but the idea I keep coming back to is to build it out with different branches (or maybe an array) that then is used to build the resulting JSON.  I think that will allow it to be built with just the relevant 1 or 2 responses.

From an error handler approach, would putting a router as the first time in the error handler to branch off based on what fields have a value and then rebuild work?

Avatar

Level 10

Thanks Jason, I figured it out and it looks messy and repetitive but no one will see the scenario but me anyway. At least it works!

I'm documenting it today so I'll post the breakdown of how it works so maybe others can benefit (or maybe even critique it and help find some efficiencies).

Avatar

Correct answer by
Level 10

Well, here it is. It's big, it's messy but it works. Setup dialog is on top, result dialog is below. I can't help but think there's a better way with less steps but for now, it works.

TASK-Add CAP to Proj Users.jpg