cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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!

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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (31,946)