Create new column in AEM cloud inbox which displays workflow initiator name | Community
Skip to main content
Level 2
January 19, 2024
Solved

Create new column in AEM cloud inbox which displays workflow initiator name

  • January 19, 2024
  • 5 replies
  • 1087 views

Hi,

 

I want to create a new column in AEM cloud inbox. It should display the name of the workflow initiator.

 

Any leads?

 

#AEM

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SRC_AEM_DEV

I have implemented the below code and it worked.

import com.adobe.cq.inbox.ui.column.Column;
import com.adobe.cq.inbox.ui.column.provider.ColumnProvider;

import com.adobe.cq.inbox.ui.InboxItem;
import org.osgi.service.component.annotations.Component;


/**
 * This provider does not require any sightly template to be defined.
 * It is used to display the workflow initiator's name as a column in the inbox.
 */
@Component(service = ColumnProvider.class, immediate = true)
public class Inbox implements ColumnProvider {
    @Override
    public Column getColumn() {
        return new Column("initiatorName", "Initiator Name", String.class.getName());
    }

    // Return the workflow initiator's name. Else returns null
    private String getInitiatorName(InboxItem inboxItem) {
        String initiatorName = inboxItem.getWorkflowInitiator();
        return initiatorName;
    }

    @Override
    public Object getValue(InboxItem inboxItem) {
        return getInitiatorName(inboxItem);
    }
}

5 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 19, 2024
Kamal_Kishor
Community Advisor
Community Advisor
January 19, 2024

@src_aem_dev : Please refer this article to see how a custom column can be added to Inbox screen.

https://experienceleague.adobe.com/docs/experience-manager-learn/forms/inbox-customization/add-married-column.html

thanks.

Kamal_Kishor
Community Advisor
Community Advisor
January 19, 2024

@src_aem_dev : As mentioned in other responses, it may not be recommended to customize it.
However, if this is a must for your requirement, you can refer one of the help article :https://experience-aem.blogspot.com/2019/05/aem-65-extend-inbox-list-view-add-column-path.html

PS: I have not tried these myself.

narendragandhi
Community Advisor
Community Advisor
January 19, 2024

Hi @src_aem_dev 

 

It looks like there is an option under admin control to add columns to inbox. Here is the link to the documentation - https://experienceleague.adobe.com/docs/experience-manager-65/content/sites/authoring/essentials/inbox.html?lang=en

 

I have not tried this yet. Please have a look and let us know if this works.

 

Thanks

Narendra

kautuk_sahni
Community Manager
Community Manager
January 23, 2024

@src_aem_dev Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
SRC_AEM_DEVAuthorAccepted solution
Level 2
January 23, 2024

I have implemented the below code and it worked.

import com.adobe.cq.inbox.ui.column.Column;
import com.adobe.cq.inbox.ui.column.provider.ColumnProvider;

import com.adobe.cq.inbox.ui.InboxItem;
import org.osgi.service.component.annotations.Component;


/**
 * This provider does not require any sightly template to be defined.
 * It is used to display the workflow initiator's name as a column in the inbox.
 */
@Component(service = ColumnProvider.class, immediate = true)
public class Inbox implements ColumnProvider {
    @Override
    public Column getColumn() {
        return new Column("initiatorName", "Initiator Name", String.class.getName());
    }

    // Return the workflow initiator's name. Else returns null
    private String getInitiatorName(InboxItem inboxItem) {
        String initiatorName = inboxItem.getWorkflowInitiator();
        return initiatorName;
    }

    @Override
    public Object getValue(InboxItem inboxItem) {
        return getInitiatorName(inboxItem);
    }
}
kautuk_sahni
Community Manager
Community Manager
June 7, 2024

@src_aem_dev I hope the AEM community has been helpful. We look forward to your return as either a learner or a contributor. The community grows with SMEs like you. Invite your AEM peers to contribute too. Happy AEM learning!

Kautuk Sahni