Forum Discussion
Extracting a substring using jpath in an adaptive card template (PnP Search)
Good morning, community.
Would you please help me understand what I am doing wrong?
Context
I installed PnP Search in one of our SharePoint team sites to extend the data our linguists and project managers need for their tasks. They liked the adaptive card template.
However, the default adaptive card template doesn't show file path information by default. Therefore, I added the 'Path' slot to the template.
Challenge
The path shown is too long, as it includes our full site path, including the library and other irrelevant subfolders. However, there is a clear pattern you can manipulate with string functions.
So far, this is what I have:
"type": "TextBlock",
"text": "${substring(jpath($data, concat('.',$root.slots['Path'],48,10)))}",
"weight": "Bolder",
"wrap": true,
"maxLines": 3
I aim to skip all the domain and site info until "/sites" (starting at index 48), but it's not working for some reason.
Do you have any thoughts?
Thanks so much,
Joshua
1 Reply
- mkubala007Copper Contributor
jdvelasquez - did you ever find a solution to this? I'm trying to do the same thing. Just want to add a substring of the full path to the file (minus the file name).