Generate links in data table column based on other column

Hi

I have a tricky feature to implement.

Users enter a document number in the first column of a data table and a link needs to be generated using this number. The link needs to be shown in the second table column.

If this can't be done just by Plumsail then can use Powerautomate also, maybe using another field outside or data table instead of the col inside it.

Dear @cknightTSY,
What's the type of the link? It's not hard to set a column value based on another column value - DataTable — SharePoint forms

However, it might be challenging depending on the type of link that you want to generate, as you need to build the URL based on the value, or do you need to retrieve the URL from somewhere else first?

Hi @Nikita_Kurguzov

It's using the number from col 1 at the end of a common link, e.g. http://imange/number?/1234

Thanks

Dear @cknightTSY,
It should be pretty straightforward:

var dt = fd.control('DataTable1');

//get a column by its name
const Column2 = dt.columns.find(c => c.field === 'Column2');
Column2.editable = () => false;

dt.$on('change', function(value) {
    if (value) {
        for (var i = 0; i < value.length; i++) {
            // populate Column2
            if(value[i].Column1){
               value[i].set('Column2', 'http://imange/number?/' + value[i].Column1);
            }
            else{
               value[i].set('Column2', '');
            }
        }
    }
});

Thanks but does this need to be wrapped in 'fd.spRendered' ? As is, it's causing errors in the whole form.

Dear @cknightTSY,
Yes, as most other code running on a SharePoint form, it does need to be inside fd.spRendered()

Thanks.

Anyway of turning the generated link strings into clickable links?

Dear @cknightTSY,
Should also be possible, try it like this:

dt.$on('change', function(value) {
    if (value) {
        for (var i = 0; i < value.length; i++) {
            // populate Column2
            if(value[i].Column1){
               value[i].set('Column2', '<a href="http://imange/number?/' + value[i].Column1 + '" target="_blank">http://imange/number?/' + value[i].Column1 + '</a>' );
            }
            else{
               value[i].set('Column2', '');
            }
        }
    }
});

Thanks but it's just shows this - in the Save to field for the data table control, it shows as text, not links
http://imanage/?number=8768876 " target="_blank">http://imange/number?/8768876

Dear @cknightTSY,
Shouldn't be the case, here is me running exactly the same code in the latest version of the app:

Thanks. Sorry I had missed a bit of the code.