Logic App: Tips and tricks

Whether you’re just getting started with Logic Apps or looking to refine your workflows, this post shares practical tips that can save you time and headaches—especially when working with SharePoint integrations. From handling approval status correctly to formatting JSON for field updates and managing choice fields in conditions, these insights will help you build smarter, more reliable automations. Let’s dive into the details.

Approve or reject an SharePoint item

To approve or reject a SharePoint item, use the Set content approval status action. This cannot be done using Create item or Update item actions.

Using JSON to Update SharePoint Fields

When creating or updating SharePoint items in Logic Apps, you’ll need to use JSON formatting to set field values correctly.

{
  "Current Status": {
    "Value": "Closed"
  }
}

For a text or date fields:

{
  "Date": "YourDateValue",
  "Text": "Example"
}

For a number field:

{
  "Number": 1
}

Using the Approval Status Field in SharePoint

To check the approval status of a SharePoint item, refer to the Approval Status field (Dutch: Goedkeuringstatus). This field reflects whether an item is PendingApproved, or Rejected.

When using this field in Power Automate or other logic-based tools, keep in mind:

  • Always use {ModerationStatus} when referencing this field in condition actions.
  • The display name of the field is Approval Status.
  • The internal name used in conditions or expressions is {ModerationStatus}.
  • Although you might see _ModerationStatus in the URL when filtering or viewing list settings, that version cannot be used directly in expressions or dynamic content.

Condition check for SharePoint choice field

When working with choice fields in SharePoint (e.g. Status), you can’t directly compare with the field name in a condition. The actual value is nested deeper in the JSON structure. Instead of checking just Status, you need to check Status.Value. This ensures you’re comparing the actual selected value of the choice field, not the object that contains it.

@items('For_each')?['Status']?['Value']

Adding a Line Break (enter) in an Append to String action

When working with a For Each loop in Logic Apps, it is often useful to collect output from each iteration. One effective approach is to use the Append to string variable action. In my solution, I needed to build a list where each item appears on a new line. To achieve this, simply add the <br> HTML tag at the end of each appended string to insert a line break.