Forum Discussion
Can no longer post empty string to blank a sharepoint choice field
You can exclude the field pilot in the json body, if you are not assigning any value.
To conditionally include a JSON body field named 'pilot' in a Graph API request from Microsoft Flow, you can use the "Compose" action along with an expression to check if the field contains data. Here's an example:
1. Add a "Compose" action before the "HTTP" action in your Microsoft Flow.
2. In the "Compose" action, use an expression to check if the field contains data. For example, you can use the following expression:
if(empty(outputs('pilot')), null, outputs('pilot'))This expression checks if the 'pilot' output is empty. If it is empty, it returns `null`. Otherwise, it returns the value of the 'pilot' output.
3. Use the output of the "Compose" action in the JSON body of the "HTTP" action. In the "Body" field of the "HTTP" action, reference the output of the "Compose" action using the dynamic content selector (the expression should be something like `@{outputs('Compose')}`).
By using this approach, the 'pilot' field will only be included in the JSON body if it has any data. If it is empty, the field will not be included in the request.
By using conditional expressions in the "Compose" action, you can dynamically construct the JSON body based on the presence or absence of data in your fields.
If I have answered your question, please mark your post as Solved If you like my response, please give it a like |
Deleted I do not want to exclude the field, I'm specifically trying to set it to be blank and override the default value!