cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
onyebuchiboss
Helper III
Helper III

How to pass collection objects as an array of strings

Hi All, can anyone with better knowledge please help? 

I am trying to pass a Json to a power automate from powerapps, but an array of object keeps getting sent, even when I enclose the passed object in a JSON. I am passing this;

 

Set(
    response,
    Update_doc_tag.Run(
        JSON(
            {
                metadata_storage_path: galleryResults.Selected.metadata_storage_path,
                tags: (Tags).Value
            }
        )
    ).response
);

 

 

The tags above is a collection of strings And the expected schema in power automate is this:

 

{
  "metadata_storage_path": "fsdfFSDGDGSAHGDHASHJSDAJHDSAJHASHSASA2",
  "tags": [
    "victor",
    "ricky"
  ]
}

 

 But it gets to power automate like this:

 

"metadata_storage_path": "ywttwetewwehhjhajdjhjddds",
	"tags": [
		{
			"Value": "schools"
		},
		{
			"Value": "jobs"
		},
		{
			"Value": "victor"
		}
	]

 

which causes a failed schema error. 

Can someone please help with how to pass an array of strings in the tags, please?

 

Thanks

@RandyHayes @RezaDorrani 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @onyebuchiboss ,

 

I did a test for you:

1\ Add a button control and set its onselect property to :

ClearCollect(tags,{Value:"schools"},{Value:"jobs"})

 

2\ Add a button control and set its onselect property to :

Test44.Run(JSON({metadata_storage_path:"Test",tags:tags.Value}))

 

3\ Build an instant flow 'Test44'.

v-xiaochen-msft_0-1618220329662.png

Generate from sample:

{
"metadata_storage_path": "Test",
"tags": [
{
"Value": "test2"
}
]
}

v-xiaochen-msft_1-1618220396138.png

 

4\ The result is as follows:

v-xiaochen-msft_2-1618220430896.png

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

 

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @onyebuchiboss ,

 

I did a test for you:

1\ Add a button control and set its onselect property to :

ClearCollect(tags,{Value:"schools"},{Value:"jobs"})

 

2\ Add a button control and set its onselect property to :

Test44.Run(JSON({metadata_storage_path:"Test",tags:tags.Value}))

 

3\ Build an instant flow 'Test44'.

v-xiaochen-msft_0-1618220329662.png

Generate from sample:

{
"metadata_storage_path": "Test",
"tags": [
{
"Value": "test2"
}
]
}

v-xiaochen-msft_1-1618220396138.png

 

4\ The result is as follows:

v-xiaochen-msft_2-1618220430896.png

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

 

View solution in original post

Thanks, it works.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (53,469)