Replace all in a list?

Hi all,

My entire app is working fine, I am just trying to clean it up a bit. So hopefully this shouldn't be hard. I can post blocks if necessary.

I have a directory list created by Taifun's excellent File extension that feeds into a list picker. I used this because I will be adding directories and didn't want to have to update my list picker each time. With this I simply drop folders into the correct directory and the app adds it to the list on launch.

The list picker selection (the entire path) then feeds into a global variable which is called later.

It basically looks like this in the list picker as the directory list includes the full path:
file://storage/emulated/o/APP/filedir1
file:/storage/emulated/o/APP/filedir2
file://storage/emulated/o/APP/filedir3
file://storage/emulated/o/APP/filedir4

and so on.

What I would like to do is eliminate file://storage/emulated/o/APP/ so the list looks like:
filedir1
filedir2
filedir3
filedir4

Normally I would use the text replace all block to accomplish this, but it doesn't seem to work with lists.

I can add the full path back in with join in the global selection so it wont mess up the rest of my blocks.

Like I said just a looks thing, but it would definitely help if someone had a solution.

You can use a for each item in list block and a local variable to create a list for your listpicker, e.g.

Brilliant way to do it.

Plugged taifunfile's "directory list" into "for each item in list" and had to take out the "file://" part in the segment to replace but it worked perfectly.

Thank you. Good to have one app complete, now I just need to figure out the javascript for a blob:https://blah/5647-c14532-65483 download and I will be ecstatic.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.