Link & Load a free text field to Multipe Select

Hi,

I wonder if there is a way to do this, would be great for what I am working on!

I have a field LOCALITY on the property unit sheet, a free text field, it gets its info from three separate fields; Closest City, Greater Area, Area/Suburb.

I Link & Load the Locality field to the Listing sheet. At the moment the loaded Locality field on the Listing sheet is set to free text. I have tried setting it to Multiple Select, hoping that it would recognize the address values provided, separated by a coma.

But as it is, it does not work, instead shows all values as a single multiple select entry, however if just one value is provided, it works fine in that case.

The reason that it is kind of important/good that a free text can actually loaded to a multiple select, is specifically because I will be able to easily search and sort this field in the sheet view, i.e. with the individual items being present in the drop-down. This seems to occur when the field is set to multiple select or even just selection.

Please, if I am missing something here, and this can actually work somehow, then please do let me know! Or if there is some other way that I should be considering, I would love to know as well!

I actually have three fields that I would like to work this way if possible!

The only real downside for now, is as I said, the search capability is somewhat diminished without having a dop-down present in teh sheet view!

I am surprised that it does not work! For if I were to import this same data else ware, into a website for instance, to populate a multiple select field, with the free text combined data field mentioned, then in that case it would recognize my free text field, and the separate values present, separated by comas.

Thanks,

Kane

Hi,

We currently don’t have a way to separate values into multiple fields when linking and loading. Given that the values of the “Locality” field is summarized from 3 fields in the original sheet, the easiest way would be to load those 3 fields on the “Listing” sheet directly for search or filter purpose.

Hi Angie (long-time),

Firstly Angie, I never did ask “to separate the values into multiple fields when linking and loading” as you have stated above.

Now, if Ragic does not allow for any required design elements, I would understand completely! However, Ragic does encourage the making of Feature Requests on this its Forum site! So, I would oblige to do so, i.e. if I stumbled across some feature that I found to not yet be present in Ragic.

The ability or feature I am referring to in this case as stated before, is to be able to “load multiple free text values, separated by comas” into a “multiple select field”. Nothing to do with separating into separate fields, like you said. Separating a combined value into separate values maybe!

I understand that you may have been implying that there is no way to do this at the moment.

So great! Thought I’d better check first!

I will now proceed to make a feature request!

Thanks for your assistance again!

Kane

Hi Kane,

Regarding the use of Multi-Select Field based on selections from other field, although it is not supported natively right now. One workaround I managed to get working is to utilize the “|” separated value.
However, since that the Multi-Select Field doesn’t allow formula input.
I had to utilize Post-Workflow to insert the value into the target “Multi-Select Field”.

For example:
If there are A (Cell H1), B (Cell H2), C (Cell H3) three fields.
And I want to insert these 3 values into the target Multi-Select field. You can use a field to prepare the [text] with value separated by “|” before insert into the target field.
image

This method doesn’t just work with values coming from fixed number of fields. You can use this to get values from subtable as well. And insert all the values into Multi-Select field. Except that when you get distinct value from subtable by “UNIQUE(xx)” you need to replace the “,” with “|” with SUBSTITUTE() so the values are separated by “|” before you insert it by Post-Workflow.

For example: SUBSTITUTE(UNIQUE(D5),“,”,“|”)

See if it helps in your scenario.

1 Like

Hi Jeremy,

Very kind of you explaining all of this to me. I really have been wondering how to go about doing this! And my JavaScript really does leave a lot to be desired…

I have a work-a-round at the moment, but it does not accommodate for equal ownership vs co-listing for starters…

This looks like it will surely do exactly what it is I would like to do!

When I have a chance to implement, I will let you know how it all goes!

Thanks again, and all the best!

Kane

1 Like

@kanefranco You are welcome.
If you run into any issue, let me know.

1 Like

Actually Jeremy,

I am getting the following error message.

TypeError: param.getNewNodeld is not a function in at line number 14

If you can help that would be great!

Thanks mate!

Kane

Did you put that code in the Post-Workflow?

Do you mind showing the code and the context where you input that code?
Maybe I can be of more help.

Hi Jeremy,

There are a couple places where I am intending to use this approach, as you have suggested!

Firstly, I am now using it as described above for a LOCALITY field!

Like I said, I got an error, so I removed code. I have just pasted it in Post Workflow. And again “TypeError: param.getNewNodeld is not a function in at line number 16”

see code pasted:
//In Post-Workflow:

//* Key Field: 1001771
var query = db.getAPIQuery(“/real-estate/32”);
var entry = query.getAPIEntry(param.getNewNodeld(1001771));

//insert Multi-Select Text values to 1004829 from 1001726
entry.setFieldValue(“1004829”,entry.getFieldValue(“1001726”));
entry.save();

What do you think?

Kane

Thanks Jeremy for getting back to me so quickly before!

I just went over everything to make sure I had not missed something, and everything seems fine!

I also took the liberty and asked Copilot! Here is what they had to say…
You

I am using Javascript //In Post-Workflow: //* Key Field: 1001771 var query = db.getAPIQuery(“/real-estate/32”); var entry = query.getAPIEntry(param.getNewNodeld(1001771)); //insert Multi-Select Text values to 1004829 from 1001726 entry.setFieldValue(“1004829”,entry.getFieldValue(“1001726”)); entry.save();

Copilot

Certainly! Let’s take a closer look at the JavaScript code snippet you’ve provided:

JavaScript

// In Post-Workflow:

// * Key Field: 1001771
var query = db.getAPIQuery("/real-estate/32");
var entry = query.getAPIEntry(param.getNewNodeld(1001771));

// Insert Multi-Select Text values to 1004829 from 1001726
entry.setFieldValue("1004829", entry.getFieldValue("1001726"));
entry.save();

AI-generated code. Review and use carefully. More info on FAQ.

Here’s a breakdown of what this code does:

  1. It initializes a query to retrieve data from the API endpoint /real-estate/32.
  2. It fetches an entry using the getAPIEntry method with the parameter param.getNewNodeld(1001771).
  3. It sets the value of the field with ID 1004829 to be the same as the value of the field with ID 1001726.
  4. Finally, it saves the modified entry.

If you have any specific questions or need further clarification, feel free to ask! :blush:

You

I am getting the following error message… TypeError: param.getNewNodeld is not a function in at line number 16

Copilot

The error message you’re encountering indicates that there’s an issue with the param.getNewNodeld function call on line 16. Let’s take a closer look at your code snippet:

JavaScript

// In Post-Workflow:

// * Key Field: 1001771
var query = db.getAPIQuery("/real-estate/32");
var entry = query.getAPIEntry(param.getNewNodeld(1001771));

// Insert Multi-Select Text values to 1004829 from 1001726
entry.setFieldValue("1004829", entry.getFieldValue("1001726"));
entry.save();

AI-generated code. Review and use carefully. More info on FAQ.

The problem lies in the usage of param.getNewNodeld. It seems that this function is not defined or available in your context. To resolve this issue, you’ll need to check the correct method or function to retrieve the desired entry.

Here are a few steps you can take to troubleshoot:

  1. Check the Correct Function Name: Verify that param.getNewNodeld is the correct function to retrieve an entry. If it’s not, find the appropriate method for fetching the entry based on your system or framework.
  2. Inspect the Documentation: Look into the documentation or resources related to your system (such as the API documentation) to find the correct way to retrieve an entry by its ID.
  3. Debugging: Consider logging or printing relevant information to debug further. For example, log the value of 1001771 to ensure it’s correct and corresponds to an existing entry.

Once you identify the correct method or function, replace param.getNewNodeld(1001771) with the appropriate code to fetch the entry by its ID. If you encounter any specific issues or need further assistance, feel free to ask! :blush:

Any idea, what the code is that we should use?
(to replace “param.getNewNodeld”).

Thanks again, and any assistance that you provide is appreciated!

Kane

I am not sure why your function didn’t work and gave that error message when using param.getNewNodeId. The alternative I got is to take that part out and put it on an individual line first, but I doubt that will make any difference if you cannot execute that in the first place.

Maybe your database got different version that doesn’t let you run that function somehow?
I tried several times, and my code ran without any issue related to param.getNewNodeId.

I even tried input a field ID that is not the Key field and it didn’t give me that error.

It is also what’s mentioned on the official Ragic guide for using workflow.

I think you need to ask Ragic Support staff.

========

//* Key Field: 1016309
//alternative:
var id = param.getNewNodeId(1016309);

var query = db.getAPIQuery(“/devtest/7”);

//original: var entry = query.getAPIEntry(param.getNewNodeId(1016309));
//alternative:
var entry = query.getAPIEntry(id);

//Insert Multi-Select Text values to 1022876 from 1022871
entry.setFieldValue(“1022876”, entry.getFieldValue(“1022871”));
entry.save();

Oh, I notice what’s wrong now.
You actually typed LD instead of ID in that function.
param.getNewNodeld(1001771) => param.getNewNodeId(1001771)

It is “Id” with a capital “i”. Not l (L).

Hi Jeremy,

I’ve made the change to the “typo” that you have pointed out above!

But, I am now getting this error…

TypeError: null has no such function “setFieldValue” in at line number 19

Getting “null” likely means that the line obtaining returned empty value (didn’t find any record).

One likely reason is that the “key field” ID that you input isn’t actually the Key Field for that Ragic form.
Be sure to check the schema provided in the Data Dictionary or in the auto generated script.
It would look something like below:

  • AP_Name: ???
  • Key Field: 1016309

or go to:

To open: Ragic API Data Dictionary