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

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!

Highlighted
Community Support
Community Support

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

Highlighted
Anonymous
Not applicable

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,

 

@Anonymous 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,982)