Hey @ts11: Unfortunately, there’s not even a “clever” or hacky way to do this. The issue is that (nearly) all expression fields are typed. This is why you see the following design pattern – where you declare a data type for the content and then have a source field that is now of that type – in repeating groups and plugins (like List Shifter) that take some input and then output some data based on that input:
The fact that these fields are typed (and the issue checker throws an error if the expression in it is of the wrong type) keeps us from being able to change both the Type of content
and the Data source
.
Of course, you can change an RG’s data source (in the conditions tab or by using an action), but you cannot dynamically change its type, and (hence) change its data source to some other type of data. (This would be possible, though, IF Bubble included Type of content
as something you could change on the conditions tab. Since this is an issue for you, I’d report that as a bug/request-for-enhancement on the bug report form. There’s no real reason it shouldn’t be an option, BTW.)
An item of trivia: In plugins, we can in fact make a field accept “any thing”. This is essentially an un-type-checked input that will accept any valid expression, regardless of what data type the expression evaluates to. I use it myself in the PROCESS List action that you find in List Shifter. (You’ll see “Anything Constant” and “Anything List Constant” fields there. These are used to import any sort of data to PROCESS List for use in that action.)
However, this doesn’t help us with your predicament because there’s no way to set a plugin’s output type to be of “any type”. The type must always be declared explicitly by the Bubble programmer. This is not to say that the type of these outputs isn’t infinitely variable – what we do in plugins is let the Bubble programmer select a type for an output via a dropdown, and then we say that the output type is “as the type selected in that particular dropdown”. But we cannot programmatically tell Bubble, “this or that output is now of type X” and change it.
An example of this is the “Process output type” field in the main interface for List Shifter. This setting is where the Bubble programmer tells the plugin what type of data they’ll be shoving to the Processed/Custom Result and Processed/Custom List outputs. (The net-net of this is the type of an output is set in the editor and cannot be modified programmatically at runtime.) Outputs can only accept data of the declared type and, if the plugin attempts to shove some different type of data to the output (which you can do quite easily with List Shifter), an error will be thrown.
All the above being said, RG’s could allow both they type and data source to change, but Bubble would have to add that (submit a bug report as I suggest above), and this would not actually be a difficult thing for them to add.
Additionally, one could write all sorts of custom repeating-group like plugins that could fix this, but they would be quite custom and we don’t at present have an API that lets us build RG-like things (any sort of group-like things, actually) so don’t hold your breath for some plugin-based solution to your issue.