Skip to main content
Question

Primary Key name from User Parameter in FeatureWriter User Attributes

  • March 24, 2025
  • 2 replies
  • 49 views

salah.elfarissi
Contributor
Forum|alt.badge.img+3

Hello,

In FeatureWriter, User Attributes,

I want to use a User Parameter as the name of my primary key.

User Parameter (in french: Primary key name)

Feature Writer (not working)

 

2 replies

donalmateer
Safer
Forum|alt.badge.img+8
  • Safer
  • March 25, 2025

Hi ​@salah.elfarissi,

Thank you for the post!
You could try using the AttributeRenamer before the FeatureWrtier.

Let’s say:

  • Your incoming features have a dynamic attribute that should be the primary key.

  • You know the name of that attribute from a user parameter.

You can rename that attribute to a consistent name.

  • Use an AttributeRenamer before the FeatureWriter.

  • Set:

    • Source Attribute: @Value(PrimaryKeyName)

    • Destination Attribute: pk_field

  • In the FeatureWriter, set Primary Key Name to pk_field

Let me know if this works!


salah.elfarissi
Contributor
Forum|alt.badge.img+3

Hello

Thank you for your response.

I think I was not clear on what I want to achieve.

I want the primary key name that my user choses be the one to use to define the primary key in my PostGIS table.

For example, if my user choses test_pk as the name of the primary key, it is test_pk to be used as the primary key and not pk_field.

The user expects to see test_pk as a primary key in his postgres tables.