cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShawnKeeneTF
Advocate I
Advocate I

Dynamic Content Code Changes When Editing

I have a flow where some early steps perform string operations:

 

  1. Find Space (outputs the numerical position of the first "space" found in a user's Display Name)
  2. Substring (uses the position from the prior step and outputs the substring containing just the user's first name)

 

I later use the substring output in an email message. It shows as

 

outputs('FirstName_Substring')?['body']

 

 

and it works fine when I save and test my flow. It will continue working fine for all flow runs until I ever click "Edit" on this flow again. As soon as it opens for editing, the email message shows this field as:

 

body('FirstName_Substring')?['body']

 

 

"Body" instead of "Output".  If I save it after it's transformed itself, the flow will fail until I delete it from the email and insert it again using the Dynamic content list to choose the "Substring" step.

 

In short: it works when first inserted and saved, but if you edit the Flow later it changes (even if you don't open/look at that code, just opening the flow for editing causes it to change).

 

example.png

3 REPLIES 3
a_hansen
Helper I
Helper I

Perhaps you could try using Compose on that substring, then inserting that output into your email?

Can you guide me a little more on that usage?  I thought I could give it a go but I must be doing it wrong.

I added a compose step immediately after my substring step, using the output of the substring as the input for Compose.

 

But when I go to the later step to edit the email body, "compose" isn't in the list of available fields to add into the email text.

 

Here's a screen snip so far:

 

substring_flow.png

Any other ideas?

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,931)