Hello Foks,
I want to remove all the "non-json" text which comes before the JSON.
using a compose action, I tried the following trim and replace combinations - however the result as not as expected.
trim(replace(replace(replace(last(split(outputs('Compose'), 'TenantDomain')), ':', ''), '}', ''), '"', ''))
trim(replace(replace(replace(last(split(outputs('Compose'), 'contosoGroup.onmicrosoft.com')), ':', ''), '}', ''), '"', ''))
Please help.
Thanks,
Account : nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn
-
Re: Remove non-json text
I used Substring to remove the initial part of the text, as follows:
A. Starting Position: indexOf(outputs('Raw_Data'),'[')
B.Total length: length(outputs('Raw_Data'))
C.Length (Difference): sub(outputs('Total_Length'),outputs('Starting_Position'))
Substring Connectors:
Text: Raw Data output
Starting Position: A
Lenght: C

Helpful resources
News and Announcements
Welcome to the Power Platform Communities - Lets Get Started!
May 14th | Power Platform Community AMA: Power Apps Edition
Quick Links
Leaderboard > Power Automate - General Discussion
#1
David_MA
8
Super User 2025 Season 1
#1
Michael E. Gernaey
8
Super User 2025 Season 1
#3
ankit_singhal
7
Super User 2025 Season 1
Overall leaderboard
Featured topics
How to Ask for Help with Your Power Automate Workflow
Product updates
Microsoft Power Platform Community release plans