cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
manu0417
Level: Powered On

Concat returning only last item multiple times

I have a gallery which has a collection to enter multiple goals. When I am trying to generate a JSON from the collection items the JSON is returned with only last item repeated number of times as the number of items.

 

From the below screenshot, I should expect the JSON to return...

[{"APSTFocusArea":"fg","GoalTitle":"sf","AchieveBy":"May 20, 2019","IWill":"ggg","SoThat":"fg","Strategy":"gggggggggggggggg","ProgressNotes":"sf"},{"APSTFocusArea":"j","GoalTitle":"jhh","AchieveBy":"May 20, 2019","IWill":"hj","SoThat":"gj","Strategy":"jjjjjjjj","ProgressNotes":"jklljh"}]

 

But the value returned is

[{"APSTFocusArea":"j","GoalTitle":"jhh","AchieveBy":"May 20, 2019","IWill":"hj","SoThat":"gj","Strategy":"jjjjjjjj","ProgressNotes":"jklljh"},

{"APSTFocusArea":"j","GoalTitle":"jhh","AchieveBy":"May 20, 2019","IWill":"hj","SoThat":"gj","Strategy":"jjjjjjjj","ProgressNotes":"jklljh"}]

 

The formula I used is

 

Concat(
GoalsCollection,
",{""APSTFocusArea"":""" & APSTFocusArea_1.Text & """,""GoalTitle"":""" & GoalTitle_1.Text & """,""AchieveBy"":""" & AchieveBy_1.SelectedDate & """,""IWill"":""" & IWill_1.Text & """,""SoThat"":""" & SoThat_1.Text & """,""Strategy"":""" & Strategy_1.Text & """,""ProgressNotes"":""" & ProgressNotes_1.Text & """}"
)

 

Why would concat pick only the last record multiple times? Has anyone experienced this before?

 

2019-05-20_14-20-15.jpg

 

Thanks in advance,

Manu

3 REPLIES 3
Super User
Super User

Re: Concat returning only last item multiple times

That's not so strange since you're getting the values from the text boxes and not the collection itself:

 

Concat(
GoalsCollection,
",{""APSTFocusArea"":""" & APSTFocusArea_1.Text & """,""GoalTitle"":""" & GoalTitle_1.Text & """,""AchieveBy"":""" & AchieveBy_1.SelectedDate & """,""IWill"":""" & IWill_1.Text & """,""SoThat"":""" & SoThat_1.Text & """,""Strategy"":""" & Strategy_1.Text & """,""ProgressNotes"":""" & ProgressNotes_1.Text & """}"
)

Change all the text boxes to the underlying field (column) in the collection, and it will work!

 

Concat(
GoalsCollection,
",{""APSTFocusArea"":""" & Collection_column1 & """,""GoalTitle"":""" & GoalTitle_1.Text & """,""AchieveBy"":""" & AchieveBy_1.SelectedDate & """,""IWill"":""" & IWill_1.Text & """,""SoThat"":""" & SoThat_1.Text & """,""Strategy"":""" & Strategy_1.Text & """,""ProgressNotes"":""" & ProgressNotes_1.Text & """}"
)

Good luck!

Community Support Team
Community Support Team

Re: Concat returning only last item multiple times

Hi @manu0417 

 

Do you test with @BitLord69 's suggestion?

If it works ok,please accept it as solution.

 

Best Regards.

Yumia

Administrator
Administrator

Re: Concat returning only last item multiple times

Hi @manu0417 can you review the above replies and update the thread if they were helpful? 

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 416 members 6,068 guests
Please welcome our newest community members: