and more in a single search tool across platforms. Read the announcement here. |
05/15/2023 04:56 AM
Hi, We are using the below syntax in the http params of a REST connector but the if else condition is not working -
"httpParams":"${if(user.employeeType.equals('GUEST')) {return '{\"invitedUserEmailAddress\":\"' + user.email + '\",\"invitedUserDisplayName\":\"' + user.displayname + '\", \"invitedUserType\":\"Guest\", \"inviteRedirectUrl\":\"https://myapps.microsoft.com\", \"sendInvitationMessage\":\"true\"}';} else {return '{\"invitedUserEmailAddress\":\"' + user.email + '\",\"invitedUserDisplayName\":\"' + user.email + '\", \"invitedUserType\":\"Guest\", \"inviteRedirectUrl\":\"https://myapps.microsoft.com\", \"sendInvitationMessage\":\"false\"}';}}",
The syntax is not working and giving 400 bad request error . Could you please help us with the correct syntax? Ternanry operator also doesn't work inside http params
05/15/2023 05:11 AM
05/15/2023 07:42 AM
"httpParams": "${requestAccessAttributes.addRemoveAlias==null?'{\"name\":{\"familyName\":\"'+user.firstname+'\",\"givenName\":\"'+user.lastname+'\"},\"password\":\"password\",\"primaryEmail\":\"'+account.name+'\",\"orgUnitPath\":\"/\"}':account.customproperty30.toString().contains(requestAccessAttributes.addRemoveAlias)?'{}':'{\"alias\": [\"'+requestAccessAttributes.addRemoveAlias.trim()+'\"]}'}",
05/15/2023 11:08 PM
Can you try this :
"httpParams": "${requestAccessAttributes.AccesstoCLM ==('Yes')?'{\"user_name\": \"'+user.firstname+'\",\"first_name\": \"'+user.firstname+'\",\"last_name\": \"'+user.lastname+'\",\"email\": \"'+user.email+'\"}':'{\"user_name\": \"'+user.firstname+'\",\"first_name\": \"'+user.firstname+'\"}'}",