cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Power Participant
Power Participant

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!

Highlighted
Community Support
Community Support

Hi @manu0417 

 

Do you test with @BitLord69 's suggestion?

If it works ok,please accept it as solution.

 

Best Regards.

Yumia

Highlighted
Anonymous
Not applicable

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

 

Thank you,

 

@Anonymous 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (14,191)