Help in Flow Script 2

Hi Gurus,

I need ahelp in flow script while calling an integration.

in an integration I’m getting below data

let InvestorTBL =
[
isEstablishment: “NO”,
designation: [
nameAr: “aa”,
nameEn: “aa”,
code: “aa”
],
registrationDate: “aa”,
person: [
idNumber: 11,
passport: [
number: “11”,
issueCountry: [
nameAr: “aa”,
nameEn: “aa”,
code: “11”
],
issueDate: “11”
],
dateOfBirth: “11”,
nameAr: “aa”,
nameEn: “aa”,
gender: “MALE”,
nationality: [
nameAr: “aa”,
nameEn: “aa”,
code: “11”
]
]
]
&
[
isEstablishment: “YES”,
designation: [
nameAr: “bb”,
nameEn: “bb”,
code: “bb”
],
registrationDate: “bb”,
person: “Nil”
];
return InvestorTBL;

Now if you see sometimes for soem data person: “Nil” , how to handle the op in ky scripyt to skip this Nil record.

Thanks in advance !!!

REST API call

Br,

Bhaski

Hi, in that example you have different columns for the two rows so the syntax seem a bit wrong.

But assuming you have the same values you should be able to return the table with: where person != “nil”

You get this data from a REST API call I assume, are you using the REST connector? If so, how did you set up your model for receiving data? Normally the connector should be able to skip objects with no content, but I’m not sure what happens if the property is set to “Nil”. Maybe you could use a Model transformation to change the data from “Nil” to an empty “person” object.

Hi Ola,

Thanks for the reply.

I have tried in script to do something person != “nil” , it’s not capturing

Hi Jonas,

Thanks for the reply.

It would be grtae if you can provide me an example for this.